package com.breezelin.freshmarket.fragments;

/**
 * Created by Breeze Lin
 * 2016/9/26 09:56
 * 1linyufeng1@gmail.com
 */

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.breezelin.freshmarket.R;
import com.breezelin.freshmarket.activities.LoginActivity;
import com.breezelin.freshmarket.app.BaseFragment;

/**
 * A simple {@link Fragment} subclass.
 * <p/>
 * 提示登录的fragment，在未登录时显示在账户tab下
 */
public class LoginFragment extends BaseFragment implements View.OnClickListener {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
	                         Bundle savedInstanceState) {
		rootView = inflater.inflate(R.layout.fragment_login, container, false);
		rootView.findViewById(R.id.btn_login).setOnClickListener(this);
		return rootView;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			// 登录按钮
			case R.id.btn_login:
				Intent intent = new Intent(getActivity(), LoginActivity.class);
				getActivity().startActivityForResult(intent, LoginActivity.CODE_LOGIN);
				break;
		}
	}
}
